{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Exception ignored in: <function ZipFileSystem.__del__ at 0x14a03d1f0>\n",
      "Traceback (most recent call last):\n",
      "  File \"/Users/dhruva/refuel-ai/lib/python3.9/site-packages/fsspec/implementations/zip.py\", line 76, in __del__\n",
      "    del self.zip\n",
      "AttributeError: zip\n"
     ]
    }
   ],
   "source": [
    "from datasets import load_dataset\n",
    "\n",
    "# dataset = load_dataset(\"mawadalla/scientific-figures-captions-context\", split='train[0:05]')\n",
    "dataset = load_dataset(\"mawadalla/scientific-figures-captions-context\", split='train', streaming=True)\n",
    "dataset_head = dataset.take(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'image': <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=597x611 at 0x169006130>}\n",
      "{'image': <PIL.PngImagePlugin.PngImageFile image mode=RGB size=1637x1795 at 0x2C98242B0>}\n"
     ]
    }
   ],
   "source": [
    "data_iterable = iter(dataset_head)\n",
    "for i in range(2):\n",
    "    print(next(data_iterable))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "refuel-ai",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
